home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / TrackObject.h < prev    next >
Text File  |  1994-11-19  |  13KB  |  319 lines

  1. /* TrackObject.h */
  2.  
  3. #ifndef Included_TrackObject_h
  4. #define Included_TrackObject_h
  5.  
  6. /* TrackObject module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* TrackWindow */
  12. /* TrackList */
  13. /* Memory */
  14. /* DataMunging */
  15. /* Array */
  16. /* FrameObject */
  17. /* Screen */
  18. /* TrackView */
  19. /* NoteObject */
  20. /* Menus */
  21. /* MainWindowStuff */
  22. /* BufferedFileInput */
  23. /* BufferedFileOutput */
  24. /* BinaryCodedDecimal */
  25. /* LoadSaveNoteVectors */
  26.  
  27. #include "MainWindowStuff.h"
  28.  
  29. struct TrackObjectRec;
  30. typedef struct TrackObjectRec TrackObjectRec;
  31.  
  32. /* forward declarations */
  33. struct CodeCenterRec;
  34. struct MainWindowRec;
  35. struct TrackListRec;
  36. struct FrameObjectRec;
  37. struct ArrayRec;
  38. struct TrackViewRec;
  39. struct MenuItemType;
  40. struct NoteObjectRec;
  41. struct BufferedInputRec;
  42. struct BufferedOutputRec;
  43.  
  44. /* create a new empty track object */
  45. TrackObjectRec*                NewTrackObject(struct CodeCenterRec* CodeCenter,
  46.                                                 struct MainWindowRec* MainWindow, struct TrackListRec* TrackList);
  47.  
  48. /* dispose of track object and all the crud it contains */
  49. void                                    DisposeTrackObject(TrackObjectRec* TrackObj);
  50.  
  51. /* find out if the object has been changed */
  52. MyBoolean                            HasTrackObjectBeenModified(TrackObjectRec* TrackObj);
  53.  
  54. /* get a copy of the object's name */
  55. char*                                    TrackObjectGetNameCopy(TrackObjectRec* TrackObj);
  56.  
  57. /* put a new name.  the object becomes the owner of the name block, so the */
  58. /* caller should not release it */
  59. void                                    TrackObjectPutName(TrackObjectRec* TrackObj, char* Name);
  60.  
  61. /* get a copy of the name of the instrument that the track will be played with */
  62. char*                                    TrackObjectGetInstrName(TrackObjectRec* TrackObj);
  63.  
  64. /* change the name of the instrument that the track will be played with.  the */
  65. /* track object will become the owner of the block of memory. */
  66. void                                    TrackObjectPutNewInstrName(TrackObjectRec* TrackObj, char* Name);
  67.  
  68. /* get a copy of the postprocessing formula */
  69. char*                                    TrackObjectGetPostProcessing(TrackObjectRec* TrackObj);
  70.  
  71. /* change the postprocessing formula.  the object becomes owner of the memory block. */
  72. void                                    TrackObjectPutNewPostProcessing(TrackObjectRec* TrackObj,
  73.                                                 char* PostProcExpr);
  74.  
  75. /* get number of frames in track */
  76. long                                    TrackObjectGetNumFrames(TrackObjectRec* TrackObj);
  77.  
  78. /* get the frame for a given track index */
  79. struct FrameObjectRec*    TrackObjectGetFrame(TrackObjectRec* TrackObj, long Index);
  80.  
  81. /* delete a range of frames from the track. */
  82. void                                    TrackObjectDeleteFrameRun(TrackObjectRec* TrackObj,
  83.                                                 long Index, long Count);
  84.  
  85. /* get a list of frames and copy them out of the track */
  86. struct ArrayRec*            TrackObjectCopyFrameRun(TrackObjectRec* TrackObj,
  87.                                                 long Index, long Count);
  88.  
  89. /* find any notes that are referencing the specified note via a tie and nullify the tie. */
  90. void                                    TrackObjectNullifyTies(TrackObjectRec* TrackObj,
  91.                                                 struct NoteObjectRec* NoteThatIsDying);
  92.  
  93. /* insert a frame at the specified position */
  94. MyBoolean                            TrackObjectInsertFrame(TrackObjectRec* TrackObj, long Index,
  95.                                                 struct FrameObjectRec* NewFrame);
  96.  
  97. /* show the window for this object.  returns True if successful */
  98. MyBoolean                            TrackObjectOpenWindow(TrackObjectRec* TrackObj);
  99.  
  100. /* notify the object that it's window is closing.  the object should take no action */
  101. void                                    TrackObjectClosingWindowNotify(TrackObjectRec* TrackObj,
  102.                                                 short NewX, short NewY, short NewWidth, short NewHeight);
  103.  
  104. /* indicate that the track has been altered starting at a certain position */
  105. /* this sends a message to all track views that have been registered. */
  106. void                                    TrackObjectAltered(TrackObjectRec* TrackObj, long Index);
  107.  
  108. /* add a track view object to the list of things that want to be notified when */
  109. /* data in this track is altered */
  110. MyBoolean                            TrackObjectAddDependentView(TrackObjectRec* TrackObj,
  111.                                                 struct TrackViewRec* TheView);
  112.  
  113. /* remove a track view object that no longer wants to be notified upon changes */
  114. void                                    TrackObjectRemoveDependentView(TrackObjectRec* TrackObj,
  115.                                                 struct TrackViewRec* TheView);
  116.  
  117. /* add a track view that wants to be seen in the background of this one. */
  118. /* this doesn't actually do too much, since we only keep the list, we don't */
  119. /* do any of the stuff required to actually show it in the background. */
  120. MyBoolean                            TrackObjectAddBackgroundObj(TrackObjectRec* TrackObj,
  121.                                                 TrackObjectRec* OtherTrackObj);
  122.  
  123. /* remove a track view that no longer wants to be seen in the background of this one */
  124. /* the list should call this on everyone when one is deleted so that there aren't */
  125. /* any dangling dependencies left around.  it is not an error to delete something */
  126. /* that isn't in the list */
  127. /* this doesn't actually do too much, since we only keep the list, we don't */
  128. /* do any of the stuff required to actually show it in the background. */
  129. void                                    TrackObjectRemoveBackgroundObj(TrackObjectRec* TrackObj,
  130.                                                 TrackObjectRec* OtherTrackObj);
  131.  
  132. /* get background object list.  (Actual thing). List of TrackObjectRec*'s */
  133. struct ArrayRec*            TrackObjectGetBackgroundList(TrackObjectRec* TrackObj);
  134.  
  135. /* get the menu item associated with this track */
  136. struct MenuItemType*    TrackObjectGetMenuItem(TrackObjectRec* TrackObj);
  137.  
  138. /* the document's name changed, so we need to update the window */
  139. void                                    TrackObjectGlobalNameChange(TrackObjectRec* TrackObj,
  140.                                                 char* NewFilename);
  141.  
  142.  
  143. /* get the default early/late hit adjustment factor */
  144. double                                TrackObjectGetEarlyLateAdjust(TrackObjectRec* TrackObj);
  145.  
  146. /* get the default first release point */
  147. double                                TrackObjectGetReleasePoint1(TrackObjectRec* TrackObj);
  148.  
  149. /* get the default first release point's from start or end flag (this is the same */
  150. /* as the mask used in each note) */
  151. unsigned long                    TrackObjectGetReleasePoint1StartEndFlag(TrackObjectRec* TrackObj);
  152.  
  153. /* get the default second release point */
  154. double                                TrackObjectGetReleasePoint2(TrackObjectRec* TrackObj);
  155.  
  156. /* get the default second release point's from start or end flag */
  157. unsigned long                    TrackObjectGetReleasePoint2StartEndFlag(TrackObjectRec* TrackObj);
  158.  
  159. /* get the default overall loudness adjustment factor */
  160. double                                TrackObjectGetOverallLoudness(TrackObjectRec* TrackObj);
  161.  
  162. /* get the default stereo positioning */
  163. double                                TrackObjectGetStereoPositioning(TrackObjectRec* TrackObj);
  164.  
  165. /* get the default surround positioning */
  166. double                                TrackObjectGetSurroundPositioning(TrackObjectRec* TrackObj);
  167.  
  168. /* get the default first accent adjust */
  169. double                                TrackObjectGetAccent1(TrackObjectRec* TrackObj);
  170.  
  171. /* get the default second accent adjust */
  172. double                                TrackObjectGetAccent2(TrackObjectRec* TrackObj);
  173.  
  174. /* get the default third accent adjust */
  175. double                                TrackObjectGetAccent3(TrackObjectRec* TrackObj);
  176.  
  177. /* get the default fourth accent adjust */
  178. double                                TrackObjectGetAccent4(TrackObjectRec* TrackObj);
  179.  
  180. /* get the default pitch displacement depth adjust */
  181. double                                TrackObjectGetPitchDisplacementDepthAdjust(TrackObjectRec* TrackObj);
  182.  
  183. /* get the default pitch displacement rate adjust */
  184. double                                TrackObjectGetPitchDisplacementRateAdjust(TrackObjectRec* TrackObj);
  185.  
  186. /* get the default pitch displacement start point */
  187. double                                TrackObjectGetPitchDisplacementStartPoint(TrackObjectRec* TrackObj);
  188.  
  189. /* get the default pitch displacement start point control flag */
  190. unsigned long                    TrackObjectGetPitchDisplacementFromStartOrEnd(
  191.                                                 TrackObjectRec* TrackObj);
  192.  
  193. /* get the default hurry-up factor */
  194. double                                TrackObjectGetHurryUp(TrackObjectRec* TrackObj);
  195.  
  196. /* get the default detuning */
  197. double                                TrackObjectGetDetune(TrackObjectRec* TrackObj);
  198.  
  199. /* get the detuning control flag */
  200. unsigned long                    TrackObjectGetDetuneControlFlag(TrackObjectRec* TrackObj);
  201.  
  202. /* get the default duration adjustment */
  203. double                                TrackObjectGetDurationAdjust(TrackObjectRec* TrackObj);
  204.  
  205. /* get the default duration adjust mode flag */
  206. unsigned long                    TrackObjectGetDurationModeFlag(TrackObjectRec* TrackObj);
  207.  
  208.  
  209. /* change the default early/late hit adjustment factor */
  210. void                                    PutTrackObjectEarlyLateAdjust(TrackObjectRec* TrackObj,
  211.                                                 double NewEarlyLateAdjust);
  212.  
  213. /* change the default first release point */
  214. void                                    PutTrackObjectReleasePoint1(TrackObjectRec* TrackObj,
  215.                                                 double NewReleasePoint1);
  216.  
  217. /* change the default first release point's from start or end flag */
  218. void                                    PutTrackObjectReleasePoint1StartEndFlag(TrackObjectRec* TrackObj,
  219.                                                 unsigned long NewReleasePoint1Flag);
  220.  
  221. /* change the default second release point */
  222. void                                    PutTrackObjectReleasePoint2(TrackObjectRec* TrackObj,
  223.                                                 double NewReleasePoint2);
  224.  
  225. /* change the default second release point's from start or end flag */
  226. void                                    PutTrackObjectReleasePoint2StartEndFlag(TrackObjectRec* TrackObj,
  227.                                                 unsigned long NewReleasePoint2Flag);
  228.  
  229. /* change the default overall loudness adjustment factor */
  230. void                                    PutTrackObjectOverallLoudness(TrackObjectRec* TrackObj,
  231.                                                 double NewOverallLoudness);
  232.  
  233. /* change the default stereo positioning value */
  234. void                                    PutTrackObjectStereoPositioning(TrackObjectRec* TrackObj,
  235.                                                 double NewStereoPositioning);
  236.  
  237. /* change the default surround positioning value */
  238. void                                    PutTrackObjectSurroundPositioning(TrackObjectRec* TrackObj,
  239.                                                 double NewSurroundPositioning);
  240.  
  241. /* change the default first accent adjust */
  242. void                                    PutTrackObjectAccent1(TrackObjectRec* TrackObj,
  243.                                                 double NewAccent1);
  244.  
  245. /* change the default second accent adjust */
  246. void                                    PutTrackObjectAccent2(TrackObjectRec* TrackObj,
  247.                                                 double NewAccent2);
  248.  
  249. /* change the default third accent adjust */
  250. void                                    PutTrackObjectAccent3(TrackObjectRec* TrackObj,
  251.                                                 double NewAccent3);
  252.  
  253. /* change the default fourth accent adjust */
  254. void                                    PutTrackObjectAccent4(TrackObjectRec* TrackObj,
  255.                                                 double NewAccent4);
  256.  
  257. /* change the default pitch displacement depth adjust */
  258. void                                    PutTrackObjectPitchDisplacementDepthAdjust(TrackObjectRec* TrackObj,
  259.                                                 double NewPitchDisplacementDepthAdjust);
  260.  
  261. /* change the default pitch displacement rate adjust */
  262. void                                    PutTrackObjectPitchDisplacementRateAdjust(TrackObjectRec* TrackObj,
  263.                                                 double NewPitchDisplacementRate);
  264.  
  265. /* change the default pitch displacement start point */
  266. void                                    PutTrackObjectPitchDisplacementStartPoint(TrackObjectRec* TrackObj,
  267.                                                 double NewPitchDisplacementStartPoint);
  268.  
  269. /* change the default pitch displacement start point control flag */
  270. void                                    PutTrackObjectPitchDisplacementFromStartOrEnd(TrackObjectRec*
  271.                                                 TrackObj, unsigned long NewPitchDisplacementStartPointControl);
  272.  
  273. /* change the default hurry-up factor */
  274. void                                    PutTrackObjectHurryUp(TrackObjectRec* TrackObj, double NewHurryUp);
  275.  
  276. /* change the default detuning */
  277. void                                    PutTrackObjectDetune(TrackObjectRec* TrackObj, double NewDetune);
  278.  
  279. /* change the detuning control flag */
  280. void                                    PutTrackObjectDetuneControlFlag(TrackObjectRec* TrackObj,
  281.                                                 unsigned long NewDetuneControlFlag);
  282.  
  283. /* change the default duration adjustment */
  284. void                                    PutTrackObjectDurationAdjust(TrackObjectRec* TrackObj,
  285.                                                 double NewDurationAdjust);
  286.  
  287. /* change the default duration adjust mode flag */
  288. void                                    PutTrackObjectDurationModeFlag(TrackObjectRec* TrackObj,
  289.                                                 unsigned long NewDurationModeFlag);
  290.  
  291. /* find out if this track should be included when we play the score */
  292. MyBoolean                            TrackObjectShouldItBePlayed(TrackObjectRec* TrackObj);
  293.  
  294. /* chage status of whether track should be played */
  295. void                                    ChangeTrackObjectShouldBePlayed(TrackObjectRec* TrackObj,
  296.                                                 MyBoolean ShouldWePlayIt);
  297.  
  298. /* read track information from the file and create a new track object */
  299. FileLoadingErrors            TrackObjectNewFromFile(TrackObjectRec** ObjectOut,
  300.                                                 struct BufferedInputRec* Input, struct CodeCenterRec* CodeCenter,
  301.                                                 struct MainWindowRec* MainWindow, struct TrackListRec* TrackList);
  302.  
  303. /* write the track information to the file. */
  304. FileLoadingErrors            TrackObjectWriteDataOut(TrackObjectRec* TrackObj,
  305.                                                 struct BufferedOutputRec* Output);
  306.  
  307. /* mark track object as saved */
  308. void                                    TrackObjectMarkAsSaved(TrackObjectRec* TrackObj);
  309.  
  310. /* make the track object write out the note array to the file */
  311. MyBoolean                            TrackObjectWriteNotesOutToFile(TrackObjectRec* TrackObj,
  312.                                                 struct BufferedOutputRec* Output);
  313.  
  314. /* load notes from the file & replace track's notes with them */
  315. MyBoolean                            TrackObjectRecoverNotesFromFile(TrackObjectRec* TrackObj,
  316.                                                 struct BufferedInputRec* Input);
  317.  
  318. #endif
  319.